var express = require('express');
var router = express.Router();
const query = require('./mysql');
router.get('/', (req, res) => {
	res.send('index');
});

// 登录
router.use('/login', require('./login'));
// 注册
router.use('/register', require('./register'));
// 学院
router.use('/college', require('./college'));
// home
router.use('/home', require('./home/home'));
// 获奖
router.use('/award', require('./award/award'));
// 论文
router.use('/essay', require('./essay/essay'));
// 专利
router.use('/patent', require('./patent/patent'));
// 项目
router.use('/project', require('./project/project'));
// work
router.use('/work', require('./work/work'));
// 竞赛
router.use('/contest', require('./contest/contest'));
// admin
router.use('/admin', require('./admin/admin'));

// 获取学科分类
router.get('/subject_classification', async (req, res) => {
	let sqlStr = `select * from subject_classification`;
	let result = await query(sqlStr);
	// if (result.length == 0) {
	// 	res.send({ status: 100, message: '无用户' });
	// }
	res.send({ status: 200, data: result });
});
module.exports = router;
